package com.example.demo.study.designmode.creational.factory;

public class Factory {
    public static IProduct getProduct(String name)
    {
        IProduct p=null;
        if("ProductA".equals(name))
        {
            p=new ProductA();
        }else if("ProductB".equals(name))
        {
            p=new ProductB();
        }
        return p;
    }
}
